Using A Laser To Blast Away A Bayer Array | Hackaday

2022-05-28 03:39:35 By : Mr. Ben Wan

A Bayer array, or Bayer filter, is what lets a digital camera take color photos. It’s an array of tiny color filters that sit on top of a camera’s CCD. The filter makes it so that each sub-pixel in the image sensor only sees red, green, or blue light. The Bayer filter is an elegant tool that gives us color digital photos, but what would you do if you wanted to remove one?

[Les Wright] has devised a way to remove the Bayer filter from the Raspberry Pi Camera. Along with filtering red, green, and blue light for their respective sensors, Bayer filters also greatly reduce the amount of UV and IR light that make it to the CCD sensor. [Les] uses the Raspberry Pi camera in his Pi-based Spectrometer, and he wants to remove the Bayer filter to improve and expand its sensitivity.

Of course, [Les] isn’t the first one to want to do this. Some have succeeded in physically scratching the filter off of the CCD, but because the Pi Camera has vital circuitry around the outside of the sensor, scratching the filter off would likely destroy the circuitry. Others have stripped it off using chemical means, so [Les] gave this a go and destroyed no small number of cameras in his attempt to strip the filter off with solvents like DMSO, brake fluid, and industrial paint stripper.

Inspired by techniques used in industry, [Les] eventually tried to use a several-kW nitrogen laser to burn off the filter (which seems appropriate given his experience with lasers). He built a rig that raster scans the laser across the sensor using stepper motors to drive micrometer bases. A USB microscope was included to allow progress to be monitored, and you can see a change in the sensor’s appearance as the filter is removed.

After blasting off the Bayer filter, [Les] plugged his improved camera into his home-built spectrometer and pointed it outside. The new camera gives the spectrometer much more uniform sensitivity and allows [Les] to see further into the IR and UV bands. The spectrometer can even detect the Fraunhofer lines—subtle dips in the sun’s spectrum from absorption by molecules in the atmosphere.

This is incredible for a DIY setup and instrument, and we can’t wait to see what [Les] does next to improve his measurements. If your spectrometry needs are more mass than visual, take a look at this home-built mass spectrometer. Home spectrometers aren’t just for examining light spectra—they can also be used to judge the ripeness of fruit!

Using a laser to remove an optical filter ( intentionally ) is certainly an interesting approach to making a B&W camera.

There are services that will remove the filter from high end DLSRs and rangefinders. You lose the color, as you indicated, but pick up a degree of sharpness.

Perhaps something similar could be viable with a USB webcam or even the camera on a mobile phone. Perhaps a lower powered laser, say 1W or so, could be used if it was focused enough. Maybe even selectively removing just one colour from the mask. Effectively having a reasonable compromise. It’s easy enough to remove the IR filter from the lens assembly of most cameras, allowing you to see a little way into the IR and UV range, transparent coca-cola etc., but removing the bayer layer array seems like it could open up new possibilities, perhaps even chemical analysis. Something for a future tricorder project.

Most all of those sensors are basically identical to the pi cameras in operational method and construction (it is just a normal phone camera module on a breakout board to mate it to a pi), so should be at least a similar process to make it work.

As for what lasing power would really be needed I have no idea at all, I assume the paper he showed would have some details on that (I didn’t catch it in the video if mentioned) but I haven’t even considered reading it yet. In theory with tight enough focus any laser could be powerful enough, but for practicality you want a big enough functional spot size that your x-y table can move reliably some fraction of that spot size – otherwise you are just going to be removing some small scattered dots/lines, and you don’t want it to take 6 months.

I can’t see how it would be possible to really remove just one colour without harming the rest of the filter, or really why you would want to. Perhaps removing all but one colour – use a well matched wavelength to the colour you want to survive for the laser and the other colours should cook much more impressively than the colour you wish to keep… But I’m far from certain, at least at this hour of the morning on no sleep (6 am and can’t manage to stay asleep right now – stupid headcold), what the result would be on the rest of the sensor – its possible you would burn out the sensor beneath the surviving filter colour, it could work fine, or the construction method would mean the whole lot blows off anyway – I think the latter two are most likely, but I know I’m neither a real expert on this process nor awake enough to really be thinking clearly…

you need proper ablation to blast the filter clean off, you can’t just melt it. This needs power, a lot of it. The pulse can be very short, so average power is not high, but you need the peak pulse power in the kW. Depending on the absorbtion, maybe a small laser engraver could work. Can be had for $2-3k direct from China and has more uses…if you can find one with a borked galvo head but working laser, you could rebuild it for much less.

Hmmm. Can you do this as a service?

Yes, there has been some interest that I wasnt really expecting, so I have ordered a small quantity of Picams to strip. Ping me a message (my details are on the ‘about’ section on YouTube) Cheers!

I wonder if it’s only glued at the edges and the laser could just be used to zap the frame?

Unfortunately not. It is besically colored photoresist and is very well bonded to the silicon

Next trick, do it yourself Lasik!

*sniff* *sniff* Why do I smell popcorn?

I see what you did there…

…and now I don’t see anything…

Interesting – I wonder if this approach manages to preserve the microlenses

Nope, it removes those as well. Photo-resist, even transparent photo-resist is opaque in the UV

How do you remove burnt residue or ablation is complete?

Watch the video, the sensor is then flushed/washed

Sure is too bad monochrome cameras don’t already exist and you have to make them this way…

A lot of colour sensors have monochrome equivalents. Although, sourcing them in small quantities can be a nuisance.

I was looking for one for a similar spectral playing project a while ago, they do exist, but damn are they pricey (at least all the ones I found were), if you can even get them to respond with a price to an individual… You would think just not bothering to apply the filter layer wouldn’t cost extra, well I suppose it might not, as the only places I found that offered such cameras offered them with all the lab certification type details that adds cost, and in higher frame-rate than a pi cam, probably more pixels, certainly a larger sensor area – can’t really remember all the details it was a while ago…

That said making them this way to me is quite awesome, know its possible in theory, but to see it done, and do so well with such basic equipment (yes I’m envious I don’t have said equipment – but its still pretty basic stuff of its sort).

So in a display there are red, green, and blue sub-pixels, though in a CCD or even CMOS imaging sensors, the Bayer filter filters the light for the whole pixel. Those sensors don’t have sub-pixels. Using various interpolation algorithms gives an RGB image.

True, but it’s not a terrible analogy for readers who aren’t familiar with Bayer patterns and the image processing needed to get the data to something that can be displayed.

Is t his the IMX477 camera?

It’s the OVA5647, I havent tried the IMX’s yet…

I believe the highpass (ir block) filter is also being removed here unless it’s the noir version of the sensor. In any case fantastic hack.

Sensor is a bit small for astronomy. But it’s pretty similar size wise to what we were using 20 years ago at the budget end, with a higher resolution.

Can Les do it to a Hasselblad medium format? Now that would be good for astronomy!

Its pretty close to what they are putting into those really expensive fully automated scopes. No eyepiece and you view though your iphone. They get great reviews on cloudynights, though all the reviewers only have one post and that was the review. Hmmm….

At least one comment here about BW cameras. The hacker is obviously pretty clever, so there must be a reason he *didn’t* use a BW camera. I would love to know what that reason is?

(unless he just did it for fun – which is a perfectly valid excuse!)

Try buying a B&W camera. They are expensive as they are mostly used for scientific applications which normally have bigger budgets. One question for the author… do the individual R G G B pixels have descreat coordinates from the singular RGB pixel? In other words. Does this give you a true higher resolution or is it just greater sensitivity?

ASI178MM costs 300 bucks, which isn’t very expensive for a camera. Admittedly still lot more expensive than picam2 but not thousands of dollars like some more serious cameras.

The OCAM-1mgn-u-t is only 160 bucks, global shutter, standard M12 lens mount and can hit upwards of 180 FPS. It’s pretty sweet for budget CV stuff.

Only 1 Megapixel. The pi cam is cheaper & has higher resolution before de Bayer ing games.

Any more details about the laser used ? is it homemade TEA ? Q-switched or not ?

It’s an MNL-100 I tore down and hacked in a previous video: https://www.youtube.com/watch?v=k5MOAKHPVG8

Output is about 76kW in 3ns (pulsed)

I would love to have a camera with one of each two green filters removes, thus giving a

pattern. That would allow to do interesting things, like true chroma with UV or IR, with “per pixel” transparency, and no motion blur problems, like the ones that plague the current “green/blue chroma” techniques. Some kind of “digital sodium vapor process”.

Is the image being captured raw, or is the software still trying to de-mosaic the image? How does the Pi handle calibration and image quality settings for the camera? Can these be bypassed? Is it possible to create custom settings to help account for new lenses and the removal of the Bayer filter?

Yeah, the software is still trying to de-bayer. It is now basically now acting like a monochrome sensor that is binning the 4 sensor sites. Kinda. Im not sure if there is a way to get raw pixel data out of it.

I should have googled it. The Pi foundation allowed raw access back in 2015 and people have been messing with de-bayered cameras since before that.

The most interesting recent thing is that they have moved to using libcamera and via the v4l2 framework, it looks like it’s possible for the community to write new camera drivers and ISP controls. It will be interesting to see what the community does with that access.

I have used a cold plasma torch ie (HF plasma) anda slow flow of O2 in a sealed chamber the plasma generates ozone had has uv light which destroys the bayer filter and does not damage the CMOS sensor. It takes about 10-12 minutes to remove the filter the process gas is pulled from the chamber and goes through a activate charcoal filter which is in front of the vacuum pump. This process also leaves no residue on the sensor surface and eliminates the computerize X,Y,Z stage. Cheers, Steve

Hi Steve, This sounds super interesting, I’ve been looking for a safe(r) way of reliably debayering my cameras for a long time, is this process documented anywhere? -Matt

A exremely interesting article. But why does he pronounce Either (eng: EI-ther “Z” eng Zed in the Amrican way.? He is British or is the engliah language now a subset of American?

How did you get the sensor’s coverglass removed?

Also monochrome converted raspberry pi cameras are available and not too expensive. Much cheaper than a Nitrogen laser. https://maxmax.com/shopper/category/9539-raspberry-pi

Just popped it off with a scalpel. Yes, but they are north of $500 bucks! I already had the N2 Laser and perhaps spent >$300 USD on the project, I have learned things, and I can now have as many monochrome cams as I want! ;-)

this is a CMOS sensor, not a CCD, right?

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.

By using our website and services, you expressly agree to the placement of our performance, functionality and advertising cookies. Learn more